home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 26.zip / BS1 part 26 / Aztec C v5.2a disk 4.adf / 204inc_i.lzh / libraries / gadtools.i < prev    next >
Text File  |  1991-03-14  |  10KB  |  298 lines

  1.     IFND LIBRARIES_GADTOOLS_I
  2. LIBRARIES_GADTOOLS_I    SET    1
  3. **
  4. **    $Filename: libraries/gadtools.i $
  5. **    $Release: 2.04 $
  6. **    $Revision: 36.10 $
  7. **    $Date: 90/11/19 $
  8. **
  9. **    gadtools.library definitions
  10. **
  11. **    (C) Copyright 1989, 1990, Commodore-Amiga, Inc.
  12. **    All Rights Reserved.
  13. **
  14.  
  15. *------------------------------------------------------------------------*
  16.  
  17.     IFND EXEC_TYPES_I
  18.     INCLUDE 'exec/types.i'
  19.     ENDC
  20.  
  21.     IFND UTILITY_TAGITEM_I
  22.     INCLUDE 'utility/tagitem.i'
  23.     ENDC
  24.  
  25.     IFND INTUITION_INTUITION_I
  26.     INCLUDE 'intuition/intuition.i'
  27.     ENDC
  28.  
  29. *------------------------------------------------------------------------*
  30.  
  31. *    The kinds (almost classes) of gadgets in the toolkit.  Use these
  32. *    identifiers when calling CreateGadgetA()
  33.  
  34. GENERIC_KIND    EQU    0
  35. BUTTON_KIND    EQU    1
  36. CHECKBOX_KIND    EQU    2
  37. INTEGER_KIND    EQU    3
  38. LISTVIEW_KIND    EQU    4
  39. MX_KIND        EQU    5
  40. NUMBER_KIND    EQU    6
  41. CYCLE_KIND    EQU    7
  42. PALETTE_KIND    EQU    8
  43. SCROLLER_KIND    EQU    9
  44. * Kind number 10 is reserved
  45. SLIDER_KIND    EQU    11
  46. STRING_KIND    EQU    12
  47. TEXT_KIND    EQU    13
  48.  
  49. NUM_KINDS    EQU    14
  50.  
  51. *------------------------------------------------------------------------*
  52.  
  53. *  These two definitions are obsolete, but are here for backwards
  54. *  compatibility.  You never need to worry about these:
  55. GADTOOLBIT    EQU    $8000
  56.  
  57. *  Use this mask to isolate the user part: *
  58. GADTOOLMASK    EQU    ~GADTOOLBIT
  59.  
  60. *------------------------------------------------------------------------*
  61.  
  62. *  'Or' the appropriate set together for your Window IDCMPFlags: *
  63.  
  64. ARROWIDCMP    EQU    GADGETUP!GADGETDOWN!INTUITICKS!MOUSEBUTTONS
  65.  
  66. BUTTONIDCMP    EQU    GADGETUP
  67. CHECKBOXIDCMP    EQU    GADGETUP
  68. INTEGERIDCMP    EQU    GADGETUP
  69. LISTVIEWIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE!ARROWIDCMP
  70.  
  71. MXIDCMP        EQU    GADGETDOWN
  72. NUMBERIDCMP    EQU    0
  73. CYCLEIDCMP    EQU    GADGETUP
  74. PALETTEIDCMP    EQU    GADGETUP
  75.  
  76. *  Use ARROWIDCMP!SCROLLERIDCMP if your scrollers have arrows: *
  77. SCROLLERIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE
  78. SLIDERIDCMP    EQU    GADGETUP!GADGETDOWN!MOUSEMOVE
  79. STRINGIDCMP    EQU    GADGETUP
  80.  
  81. TEXTIDCMP    EQU    0
  82.  
  83. *------------------------------------------------------------------------*
  84.  
  85. *  Typical suggested spacing between "elements": *
  86. INTERWIDTH    EQU    8
  87. INTERHEIGHT    EQU    4
  88.  
  89. *------------------------------------------------------------------------*
  90.  
  91. *  Generic NewGadget used by several of the gadget classes: *
  92.  
  93.     STRUCTURE NewGadget,0
  94.  
  95.     WORD    gng_LeftEdge
  96.     WORD    gng_TopEdge    ; gadget position
  97.     WORD    gng_Width
  98.     WORD    gng_Height    ;  gadget size
  99.     APTR    gng_GadgetText    ; gadget label
  100.     APTR    gng_TextAttr    ; desired font for gadget label
  101.     UWORD    gng_GadgetID    ; gadget ID
  102.     ULONG    gng_Flags    ; see below
  103.     APTR    gng_VisualInfo    ; Set to retval of GetVisualInfo()
  104.     APTR    gng_UserData    ; gadget UserData
  105.  
  106.     LABEL    gng_SIZEOF
  107.  
  108. *   ng_Flags control certain aspects of the gadget.  The first five control
  109. *   the placement of the descriptive text.  All larger groups supply a
  110. *   default:
  111.  
  112. PLACETEXT_LEFT    EQU    $0001    * Right-align text on left side
  113. PLACETEXT_RIGHT    EQU    $0002    * Left-align text on right side
  114. PLACETEXT_ABOVE    EQU    $0004    * Center text above
  115. PLACETEXT_BELOW    EQU    $0008    * Center text below
  116. PLACETEXT_IN    EQU    $0010    * Center text on
  117.  
  118. NG_HIGHLABEL    EQU    $0020    * Highlight the label
  119.  
  120. *------------------------------------------------------------------------*
  121.  
  122. * Fill out an array of these and pass that to CreateMenus():
  123.  
  124.     STRUCTURE NewMenu,0
  125.  
  126.     UBYTE    gnm_Type        ; See below
  127.     UBYTE    gnm_Pad            ; alignment padding
  128.     APTR    gnm_Label        ; Menu's label
  129.     APTR    gnm_CommKey        ; MenuItem Command Key Equiv
  130.     UWORD    gnm_Flags        ; Menu or MenuItem flags (see note)
  131.     LONG    gnm_MutualExclude    ; MenuItem MutualExclude word
  132.     APTR    gnm_UserData        ; For your own use, see note
  133.  
  134.     LABEL    gnm_SIZEOF
  135.  
  136. *  Each nm_Type should be one of these:
  137. NM_TITLE    EQU    1
  138. NM_ITEM        EQU    2
  139. NM_SUB        EQU    3
  140. NM_END        EQU    0
  141.  
  142. MENU_IMAGE    EQU    128
  143. IM_ITEM        EQU    NM_ITEM!MENU_IMAGE
  144. IM_SUB        EQU    NM_SUB!MENU_IMAGE
  145.  
  146. *  If you set your label to NM_BARLABEL, you'll get a separator bar.
  147. NM_BARLABEL    EQU    -1
  148.  
  149.  
  150. *   The nm_Flags field is used to fill out either the Menu->Flags or
  151. *   MenuItem->Flags field.  Note that the sense of the MENUENABLED or
  152. *   ITEMENABLED bit is inverted between this use and Intuition's use,
  153. *   in other words, NewMenus are enabled by default.  The following
  154. *   labels are provided to disable them:
  155.  
  156. NM_MENUDISABLED    EQU    MENUENABLED
  157. NM_ITEMDISABLED    EQU    ITEMENABLED
  158.  
  159. *   The following are pre-cleared (COMMSEQ, ITEMTEXT, and HIGHxxx are set
  160. *   later as appropriate):
  161.  
  162. NM_FLAGMASK    EQU    ~(COMMSEQ!ITEMTEXT!HIGHFLAGS)
  163.  
  164. *   You may choose among CHECKIT, MENUTOGGLE, and CHECKED.
  165. *   Toggle-select menuitems are of type CHECKIT!MENUTOGGLE, along
  166. *   with CHECKED if currently selected.  Mutually exclusive ones
  167. *   are of type CHECKIT, and possibly CHECKED too.  The nm_MutualExclude
  168. *   is a bit-wise representation of the items excluded by this one,
  169. *   so in the simplest case (choose 1 among n), these flags would be
  170. *   ~1, ~2, ~4, ~8, ~16, etc.  See the Intuition Menus chapter.
  171.  
  172. *   A UserData pointer can be associated with each Menu and MenuItem structure.
  173. *   The CreateMenus() call allocates space for a UserData after each
  174. *   Menu or MenuItem (header, item or sub-item).  You should use the
  175. *   GTMENU_USERDATA or GTMENUITEM_USERDATA macro to extract it. */
  176.  
  177. GTMENU_USERDATA    MACRO
  178.         move.l    mu_SIZEOF(\1),\2
  179.         ENDM
  180.  
  181. GTMENUITEM_USERDATA    MACRO
  182.         move.l    mi_SIZEOF(\1),\2
  183.         ENDM
  184.  
  185. *  Here is an old one for compatibility.  Do not use in new code!
  186. MENU_USERDATA    MACRO
  187.         move.l    mi_SIZEOF(\1),\2
  188.         ENDM
  189.  
  190.  
  191. *  These return codes can be obtained through the GTMN_ErrorCode tag:
  192. GTMENU_TRIMMED    EQU    $00000001    ; Too many menus, items, or subitems,
  193.                     ; menu has been trimmed down
  194. GTMENU_INVALID    EQU    $00000002    ; Invalid NewMenu array
  195. GTMENU_NOMEM    EQU    $00000003    ; Out of memory
  196.  
  197.  
  198. *------------------------------------------------------------------------*
  199.  
  200. *  Tags for toolkit functions:
  201.  
  202. GT_TagBase    EQU    TAG_USER+$80000 ; Begin counting tags
  203.  
  204. GTVI_NewWindow    EQU    GT_TagBase+$01    ; NewWindow struct for GetVisualInfo
  205. GTVI_NWTags    EQU    GT_TagBase+$02    ; NWTags for GetVisualInfo
  206.  
  207. GT_Private0    EQU    GT_TagBase+$03    ; (private)
  208.  
  209. GTCB_Checked    EQU    GT_TagBase+$04    ; State of checkbox
  210.  
  211. GTLV_Top    EQU    GT_TagBase+$05    ; Top visible one in listview
  212. GTLV_Labels    EQU    GT_TagBase+$06    ; List to display in listview
  213. GTLV_ReadOnly    EQU    GT_TagBase+$07    ; TRUE if listview is to be read-only
  214. GTLV_ScrollWidth    EQU    GT_TagBase+$08    ; Width of scrollbar
  215.  
  216. GTMX_Labels    EQU    GT_TagBase+$09    ; NULL-terminated array of labels
  217. GTMX_Active    EQU    GT_TagBase+$0A    ; Active one in mx gadget
  218.  
  219. GTTX_Text    EQU    GT_TagBase+$0B    ; Text to display
  220. GTTX_CopyText    EQU    GT_TagBase+$0C    ; Copy text label instead of referencing it
  221.  
  222. GTNM_Number    EQU    GT_TagBase+$0D    ; Number to display
  223.  
  224. GTCY_Labels    EQU    GT_TagBase+$0E    ; NULL-terminated array of labels
  225. GTCY_Active    EQU    GT_TagBase+$0F    ; The active one in the cycle gad
  226.  
  227. GTPA_Depth    EQU    GT_TagBase+$10    ; Number of bitplanes in palette
  228. GTPA_Color    EQU    GT_TagBase+$11    ; Palette color
  229. GTPA_ColorOffset    EQU    GT_TagBase+$12    ; First color to use in palette
  230. GTPA_IndicatorWidth    EQU    GT_TagBase+$13    ; Width of current-color indicator
  231. GTPA_IndicatorHeight    EQU    GT_TagBase+$14    ; Height of current-color indicator
  232.  
  233. GTSC_Top    EQU    GT_TagBase+$15    ; Top visible in scroller
  234. GTSC_Total    EQU    GT_TagBase+$16    ; Total in scroller area
  235. GTSC_Visible    EQU    GT_TagBase+$17    ; Number visible in scroller
  236. GTSC_Overlap    EQU    GT_TagBase+$18    ; Unused
  237.  
  238. * GT_TagBase+$19 through GT_TagBase+$25 are reserved
  239.  
  240. GTSL_Min    EQU    GT_TagBase+$26    ; Slider min value
  241. GTSL_Max    EQU    GT_TagBase+$27    ; Slider max value
  242. GTSL_Level    EQU    GT_TagBase+$28    ; Slider level
  243. GTSL_MaxLevelLen    EQU    GT_TagBase+$29    ; Max length of printed level
  244. GTSL_LevelFormat    EQU    GT_TagBase+$2A    ; Format string for level
  245. GTSL_LevelPlace    EQU    GT_TagBase+$2B    ; Where level should be placed
  246. GTSL_DispFunc    EQU    GT_TagBase+$2C    ; Callback for number calculation before display
  247.  
  248. GTST_String    EQU    GT_TagBase+$2D    ; String gadget's displayed string
  249. GTST_MaxChars    EQU    GT_TagBase+$2E    ; Max length of string
  250.  
  251. GTIN_Number    EQU    GT_TagBase+$2F    ; Number in integer gadget
  252. GTIN_MaxChars    EQU    GT_TagBase+$30    ; Max number of digits
  253.  
  254. GTMN_TextAttr    EQU    GT_TagBase+$31    ; MenuItem font TextAttr
  255. GTMN_FrontPen    EQU    GT_TagBase+$32    ; MenuItem text pen color
  256.  
  257. GTBB_Recessed    EQU    GT_TagBase+$33    ; Make BevelBox recessed
  258.  
  259. GT_VisualInfo    EQU    GT_TagBase+$34    ; result of VisualInfo call
  260.  
  261. GTLV_ShowSelected    EQU    GT_TagBase+$35    ; show selected entry beneath listview,
  262.             ; set tag data = NULL for display-only, or pointer
  263.             ; to a string gadget you've created
  264. GTLV_Selected    EQU    GT_TagBase+$36    ; Set ordinal number of selected entry in the list
  265. GT_Reserved0    EQU    GT_TagBase+$37    ; Reserved
  266. GT_Reserved1    EQU    GT_TagBase+$38    ; Reserved for future use
  267.  
  268. GTTX_Border    EQU    GT_TagBase+$39    ; Put a border around Text-display gadgets
  269. GTNM_Border    EQU    GT_TagBase+$3A    ; Put a border around Number-display gadgets
  270.  
  271. GTSC_Arrows    EQU    GT_TagBase+$3B    ; Specify size of arrows for scroller
  272. GTMN_Menu    EQU    GT_TagBase+$3C    ; Pointer to Menu for use by
  273.             ; LayoutMenuItems()
  274. GTMX_Spacing    EQU    GT_TagBase+$3D    ; Added to font height to
  275.             ; figure spacing between mx choices.  Use this
  276.             ; instead of LAYOUTA_SPACING for mx gadgets.
  277.  
  278. *  New to V37 GadTools.  Ignored by GadTools V36.
  279. GTMN_FullMenu    EQU    GT_TagBase+$3E  ; Asks CreateMenus() to
  280.         ; validate that this is a complete menu structure
  281. GTMN_SecondaryError    EQU    GT_TagBase+$3F  ; ti_Data is a pointer
  282.         ; to a ULONG to receive error reports from CreateMenus()
  283. GT_Underscore    EQU    GT_TagBase+$40    ; ti_Data points to the symbol
  284.         ; that preceeds the character you'd like to underline in a
  285.         ; gadget label
  286.  
  287. *------------------------------------------------------------------------*
  288.  
  289. * "NWay" is an old synonym for cycle gadgets
  290.  
  291. NWAY_KIND    EQU    CYCLE_KIND
  292. NWAYIDCMP    EQU    CYCLEIDCMP
  293.  
  294. GTNW_Labels    EQU    GTCY_Labels
  295. GTNW_Active    EQU    GTCY_Active
  296.  
  297.     ENDC
  298.